import http from '../../utils/http/request'

// 根据ID查询新闻播报
export function getNewsIdList(params) {

    return http.get('/sys/rotation/info/'+params)
}

// 发布公告
export function getNewsRelease(id,status) {
    return http.get('/sys/rotation/release/'+id+'/'+status)
}

//获取新闻数据
export function getNewsList(data) {
    // return http({
    //     url: '/sys/rotation/list',
    //     method: 'POST',
    //     params: data
    // })
    return http.post('/sys/rotation/list',data)
}

//新增新闻数据
export function addNews(data) {
    return http({
        url: '/sys/rotation/save',
        method: 'POST',
        data
    })
    // return http.post('/sys/rotation/save',data)
}
//更新新闻数据
export function updateNews(data) {
    return http({
        url: '/sys/rotation/update',
        method: 'POST',
        data
    })
}

//删除新闻数据
export function delNews(data) {
    return http({
        url: '/sys/rotation/delete',
        method: 'GET',
        params: data
    })
}

//上传新闻图片
export function uploadImage(data) {
    // return http({
    //     url: '/sys/rotation/uploadImage',
    //     method: 'POST',
    //     params: data
    // })
    return http.post('/sys/rotation/uploadImage',data)
}
